<div class="tabbable tabs-left">
              <ul class="nav nav-tabs">
              	<li><h5><?php echo $this->translate('文章信息'); ?></h5></li>
                <li class="active"><a data-toggle="tab" href="#cms_a"><?php echo $this->translate('基本信息'); ?></a></li>
                <li><a data-toggle="tab" href="#cms_b"><?php echo $this->translate('搜索引擎优化'); ?></a></li>
              </ul>
              <form class="form-horizontal" name="cms_form" id="cms_form" method="post" action="">
              <input type="hidden" name="article_id" id="article_id" value="<?php if($this->article_info) echo $this->article_info->article_id; else echo ''; ?>" />
              <div class="tab-content">
    			<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        			<div class="pull-left" style="font-size:16px;line-height:30px;"><strong><?php if($this->article_info) echo $this->translate('编辑'); else echo $this->translate('新加'); ?><?php echo $this->translate('文章'); ?></strong></div>
        			<div class="pull-right">
                	<a href="<?php echo isset($this->article_info) ? $this->url('cms/default/article_page',array('action'=>'index','controller'=>'cms', 'page'=>$this->page), array('query'=>$this->query)) : $this->url('cms/default',array('action'=>'index','controller'=>'cms')); ?>" class="btn btn-small"><i class="icon-arrow-left"></i> <?php echo $this->translate('返回文章列表'); ?></a>&nbsp;
                	<a href="<?php echo $this->serverUrl(true); ?>" class="btn btn-small btn-warning"><i class="icon-repeat icon-white"></i> <?php echo $this->translate('刷新'); ?></a>&nbsp;
                    <?php if($this->article_info) { ?>
                    <a href="javascript:;" onclick="return article_del_js(<?php echo $this->article_info->article_id ?>);" class="btn btn-small btn-danger"><i class="icon-remove icon-white"></i> <?php echo $this->translate('删除文章'); ?></a>&nbsp;
                    <?php } ?>
                	<button type="submit" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存文章信息'); ?></button>&nbsp;
                	<a href="<?php echo $this->myviewalias()->dbshopHelpUrl('cms_set'); ?>" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> <?php echo $this->translate('查看帮助说明'); ?></a>
                	</div>
        		</div>
                <div id="cms_a" class="tab-pane active">
                	<div class="well admin_add_header_well"><?php echo $this->translate('基本信息'); ?></div>
                	<div class="well admin_add_well"> 
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章标题'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="article_title"  name="article_title" class="span8" value="<?php echo ($this->article_info ? $this->escapeHtml($this->article_info->article_title) : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章分类'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<select id="article_class_id" name="article_class_id" class="span2">
                                <option value=""><?php echo $this->translate('请选择'); ?></option>
                                <?php
                                if ($this->article_class) {
                                	foreach ($this->article_class as $class_val) {
								?>
                                <option value="<?php echo $class_val['article_class_id'] ?>" <?php if(($this->article_info and $this->article_info->article_class_id == $class_val['article_class_id']) or ($class_val['article_class_id'] == $this->article_class_id)) { ?>selected="selected"<?php } ?>><?php echo str_repeat('&nbsp;', $class_val['class_level'] * 5).$class_val['article_class_name']; ?></option>
                                <?php
                                	}
                                }
								?>
                                </select>
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章作者'); ?>：</label>
           					<div class="controls">
              					<input type="text" id="article_writer"  name="article_writer" class="span5" value="<?php echo ($this->article_info ? $this->escapeHtml($this->article_info->article_writer) : ''); ?>">
            				</div>                        
                        </div>                    	
                        <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章内容'); ?>：</label>
           					<div class="controls">
              					<script type="text/plain" id="article_body" name="article_body"><?php echo ($this->article_info ? $this->article_info->article_body : ''); ?></script>
            				</div>                        
                        </div>                     
                        <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('URL跳转地址'); ?>：</label>
           					<div class="controls">
              					<input type="text" id="article_url"  name="article_url" class="span6" value="<?php echo ($this->article_info ? $this->escapeHtml($this->article_info->article_url) : ''); ?>">
            				</div>                        
                        </div>                        
                        <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章创建时间'); ?>：</label>
           					<div class="controls">
              					<input type="text"  id="article_add_time"  name="article_add_time" value="<?php echo ($this->article_info ? date('Y-m-d H:i', $this->article_info->article_add_time) : ''); ?>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',el:'article_add_time'})" class="span3 Wdate">
            				</div>                        
                        </div>                    	
                        <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章状态'); ?>：</label>
           					<div class="controls">
              					<label class="radio inline"><input type="radio" name="article_state" value="1" <?php if(($this->article_info and $this->article_info->article_state == 1) or !isset($this->article_info)) echo 'checked="checked"'; ?> /><?php echo $this->translate('启用'); ?></label>
                                <label class="radio inline"><input type="radio" name="article_state" value="0" <?php if($this->article_info and $this->article_info->article_state == 0) echo 'checked="checked"'; ?> /><?php echo $this->translate('禁用'); ?></label>
            				</div>                        
                        </div>                        
                        <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章排序'); ?>：</label>
           					<div class="controls">
              					<input type="text" class="span2" value="<?php if($this->article_info and $this->article_info->article_sort) echo $this->article_info->article_sort; else echo '255'; ?>" name="article_sort" id="article_sort"  />
            				</div>                        
                        </div>                                                                                                                                               
                  	</div>
                </div>
				<div id="cms_b" class="tab-pane">
                	<div class="well admin_add_header_well"><?php echo $this->translate('搜索引擎优化'); ?></div>
                	<div class="well admin_add_well"> 
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('扩展标题'); ?>：</label>
           					<div class="controls">
              					<input type="text" id="article_title_extend"  name="article_title_extend" class="span12" value="<?php echo ($this->article_info ? $this->escapeHtml($this->article_info->article_title_extend) : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章关键字'); ?>：</label>
           					<div class="controls">
              					<input type="text" id="article_keywords"  name="article_keywords" class="span12" value="<?php echo ($this->article_info ? $this->escapeHtml($this->article_info->article_keywords) : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('文章描述'); ?>：</label>
           					<div class="controls">
              					<textarea id="article_description"  name="article_description" class="span12" rows="3"><?php echo ($this->article_info ? $this->escapeHtml($this->article_info->article_description) : ''); ?></textarea>
            				</div>                        
                        </div>                    	                                                                                                                                               
                  	</div>
                </div>
                 
             </div>
              </form>
</div>
<script src="<?php echo $this->basePath('/public/js/DatePicker/WdatePicker.js'); ?>"></script>
<?php echo $this->partial('common/editor',array('edit_array'=>array('article_body'))); ?>
<script>
//客户分组保存验证
$(document).ready(function() {
	$("#cms_form").validate({
		rules: {
			article_title: {
				required: true,
				maxlength:60
			},
			article_class_id: {
				required: true
			},
			article_sort: {
				number: true,
				min:1,
				max:255
			}
		},
		messages: {
			article_title: {
				required: "<?php echo $this->translate('请输入文章名称！'); ?>",
				maxlength:"<?php echo $this->translate('文章名称最长为60个汉字！'); ?>"
			},
			article_class_id: {
				required: "<?php echo $this->translate('请选择文章分类！'); ?>"
			},
			article_sort: {
				number: "<?php echo $this->translate('文章排序必须为数字'); ?>",
				min:"<?php echo $this->translate('文章排序最小为1'); ?>",
				max:"<?php echo $this->translate('文章排序最大为255'); ?>"
			}
		}
	});
});
//文章删除js
function article_del_js(article_id) {
	if(window.confirm('<?php echo $this->translate('您确实要删除该文章吗？'); ?>')) {
	$.post("<?php echo $this->url('cms/default',array('action'=>'del','controller'=>'cms')); ?>",{article_id:article_id},
	function(data){
		if(data != 'false') {
			window.location.href='<?php echo $this->url('cms/default/article_page',array('action'=>'index','controller'=>'cms', 'page'=>$this->page), array('query'=>$this->query)); ?>';
			return true;
		} else {
			alert('<?php echo $this->translate('文章删除失败！'); ?>');
		}
	});
	}
	return false;
}
</script>